<?php
set_time_limit(0);
$yx=explode("\r\n", file_get_contents('1.txt'));
foreach ($yx as $v){
    $name=trim($v);
    if (!empty($name)){
        $sql = "insert into j(name) values ('".$name."');";
        echo $sql;
        echo "<br />";
    }
}